package com.gsafety.wellsfort.dao.course;

import com.gsafety.wellsfort.domain.dto.course.MyWorkDTO;
import com.gsafety.wellsfort.domain.dto.course.WorkFinishPreviewDTO;
import com.gsafety.wellsfort.domain.model.course.StudentWork;
import com.gsafety.wellsfort.domain.vo.MyQuestionVO;
import com.gsafety.wellsfort.domain.vo.StudentWorkFinishRecordVO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface StudentWorkDAO {
    int deleteByPrimaryKey(Integer id);

    int deleteByWorkPublishId(Integer workPublishId);

    int deleteByParamMap(Map<String, Object> param);

    int insert(StudentWork record);

    int insertSelective(StudentWork record);

    StudentWork selectByPrimaryKey(Integer id);

    List<StudentWork> workDetail(MyWorkDTO myworkDto);

    List<MyQuestionVO> myWorkQuestion(MyWorkDTO myworkDto);

    List<StudentWorkFinishRecordVO> selectByFinishPreviewDTO(WorkFinishPreviewDTO dtoParams);

    Integer countPublishNum(Integer workPublishId);

    Integer countFinishByState(@Param("studentId")Integer studentId,@Param("finishState")Integer finishState,@Param("endTime")Date endTime);

    Integer countPublishFinishNum(@Param("workPublishId")Integer workPublishId,@Param("workId")Integer workId,@Param("finishState")Integer finishState);

    int updateByPrimaryKeySelective(StudentWork record);

    int updateByPrimaryKey(StudentWork record);

    List<StudentWork> selectByCondition(MyWorkDTO myWorkDTO);

    List<StudentWork> selectByParam(StudentWork record);

    int countStartTimeByRange(@Param("createdStart") Date startTime, @Param("createdEnd") Date endTime);

    List<StudentWork> getDoingWork();
}